// 创建layout组件相关的小仓库
import { defineStore } from 'pinia'
import { ref, nextTick } from 'vue'

// 创建layout组件相关的小仓库
const useLayOutSettingStore = defineStore('Setting', () => {
  // 用于控制菜单折叠图标的状态
  const fold = ref(false)
  // 控制当前组件是否需要销毁重建
  const flag = ref(false)
  const refsh = () => {
    // 点击刷新按钮：使路由组件销毁重建
    flag.value = true
    nextTick(() => {
      flag.value = false
    })
  }
  return {
    fold,
    flag,
    refsh,
  }
})

export default useLayOutSettingStore
